package com.ml.mall.enums;

/**
 * Created by kyyang on 2020/12/31 12:52
 */
public enum RedisUtilsCacheEnum {
    //购物车前缀
//    SHOPPING_CART_COUPON_KEY("SHOPPING_CART_COUPPON:","购物车优惠券缓存",false,0),
    SHOPPING_CART_KEY("SHOPPING_CART:","购物车缓存",false,0),
    REDIS_KEY_COMPARISON("redis_key_comparison:","对比缓存前缀",false,0),
    REDIS_KEY_USER_COMPANY_RELATION("redis_key_user_company_relation:","用户公司关系前缀",false,0),
    REDIS_KEY_USER_FORGET_PWD("redis_key_user_forget_pwd:","忘记密码生成验证码前缀",true,600),
    REDIS_KEY_CAPTCHA("redis_key_captcha:","图片验证码",true,600),
    //模板；
    TEST_111("test_redis_key","测试缓存前缀",true,3600*5);

    private String redisKeyPrefix; //带『:』直接后接key 就行了
    private String desc;           //描述
    private Boolean haveExpires;   //是否拥有过期时间
    private int    expiresSecond;  //统一制定过期时间：秒

    RedisUtilsCacheEnum(String redisKeyPrefix, String desc, Boolean haveExpires,int expiresSecond ){
        this.redisKeyPrefix = redisKeyPrefix;
        this.desc = desc;
        this.haveExpires = haveExpires;
        this.expiresSecond = expiresSecond;
    }


    public String getKeyPrefix() {
        return redisKeyPrefix;
    }

    public String getDesc() {
        return desc;
    }

    public Boolean getHaveExpires() {
        return haveExpires;
    }

    public int getExpiresSecond() {
        return expiresSecond;
    }
}
